/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include "../../缓存/设备内存缓存.h"
#include "底层绘图/S_纹理.h"

#include "../core/DX头.h"




using namespace Microsoft::WRL;




typedef struct {
	int3_64 size;
	uint32	dim;
	uint32	type;
	uint32	format;
	uint16	mip;
	uint16	sample;
	uint16	sampleQuality;

}S_纹理创建参数;


void f_取纹理采样级别(ID3D12Device* dev, S_纹理创建参数& 参数);



struct S_DX纹理缓存 : public S_GPU缓存_D3 {

	ComPtr<ID3D12Resource>		m_Data;
	//ComPtr<ID3D12DepthStencilView> a;

	S_DX纹理缓存();


	uint32	f_创建内存对象(const void* c, void* ctx = 0, uint32 key=0);

	void	f_Fill(void* data, int3_64 size, void* ctx = 0);


	virtual void*	f_map();
	virtual void	f_unmap();


};



S_DX纹理缓存* f_创建深度模板纹理(ID3D12Device* dev, ivec2& 参数, uint32 采样, uint32 key = 0);


